import 'package:enterprise_v6_app/generated/json/base/json_convert_content.dart';
import 'package:enterprise_v6_app/app/data/entities/application/special_list/work_today_status_entity.dart';

WorkTodayStatusEntity $WorkTodayStatusEntityFromJson(Map<String, dynamic> json) {
  final WorkTodayStatusEntity workTodayStatusEntity = WorkTodayStatusEntity();
  final int? contractorCount = jsonConvert.convert<int>(json['contractorCount']);
  if (contractorCount != null) {
    workTodayStatusEntity.contractorCount = contractorCount;
  }
  final int? contractorViolationCount = jsonConvert.convert<int>(json['contractorViolationCount']);
  if (contractorViolationCount != null) {
    workTodayStatusEntity.contractorViolationCount = contractorViolationCount;
  }
  final int? contractorWorkCount = jsonConvert.convert<int>(json['contractorWorkCount']);
  if (contractorWorkCount != null) {
    workTodayStatusEntity.contractorWorkCount = contractorWorkCount;
  }
  final int? doingCount = jsonConvert.convert<int>(json['doingCount']);
  if (doingCount != null) {
    workTodayStatusEntity.doingCount = doingCount;
  }
  final int? doneCount = jsonConvert.convert<int>(json['doneCount']);
  if (doneCount != null) {
    workTodayStatusEntity.doneCount = doneCount;
  }
  final int? innerCount = jsonConvert.convert<int>(json['innerCount']);
  if (innerCount != null) {
    workTodayStatusEntity.innerCount = innerCount;
  }
  final int? innerViolationCount = jsonConvert.convert<int>(json['innerViolationCount']);
  if (innerViolationCount != null) {
    workTodayStatusEntity.innerViolationCount = innerViolationCount;
  }
  final int? innerWorkCount = jsonConvert.convert<int>(json['innerWorkCount']);
  if (innerWorkCount != null) {
    workTodayStatusEntity.innerWorkCount = innerWorkCount;
  }
  final int? stopCount = jsonConvert.convert<int>(json['stopCount']);
  if (stopCount != null) {
    workTodayStatusEntity.stopCount = stopCount;
  }
  return workTodayStatusEntity;
}

Map<String, dynamic> $WorkTodayStatusEntityToJson(WorkTodayStatusEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['contractorCount'] = entity.contractorCount;
  data['contractorViolationCount'] = entity.contractorViolationCount;
  data['contractorWorkCount'] = entity.contractorWorkCount;
  data['doingCount'] = entity.doingCount;
  data['doneCount'] = entity.doneCount;
  data['innerCount'] = entity.innerCount;
  data['innerViolationCount'] = entity.innerViolationCount;
  data['innerWorkCount'] = entity.innerWorkCount;
  data['stopCount'] = entity.stopCount;
  return data;
}

extension WorkTodayStatusEntityExtension on WorkTodayStatusEntity {
  WorkTodayStatusEntity copyWith({
    int? contractorCount,
    int? contractorViolationCount,
    int? contractorWorkCount,
    int? doingCount,
    int? doneCount,
    int? innerCount,
    int? innerViolationCount,
    int? innerWorkCount,
    int? stopCount,
  }) {
    return WorkTodayStatusEntity()
      ..contractorCount = contractorCount ?? this.contractorCount
      ..contractorViolationCount = contractorViolationCount ?? this.contractorViolationCount
      ..contractorWorkCount = contractorWorkCount ?? this.contractorWorkCount
      ..doingCount = doingCount ?? this.doingCount
      ..doneCount = doneCount ?? this.doneCount
      ..innerCount = innerCount ?? this.innerCount
      ..innerViolationCount = innerViolationCount ?? this.innerViolationCount
      ..innerWorkCount = innerWorkCount ?? this.innerWorkCount
      ..stopCount = stopCount ?? this.stopCount;
  }
}
